import axios from "axios";
export default {
  common: {
    method: 'GET',
    data: {},
    params: {},
    headers: {}
  },
  $axios (options = {}) {
    options.method = options.method || this.common.method
    options.data = options.data || this.common.data
    options.params = options.params || this.common.params
    options.headers = options.headers || this.common.headers
    return axios(options).then(v => {
      
   

      
      return new Promise((res, rej) => {
        // eslint-disable-next-line prefer-promise-reject-errors
        if (!v) return rej()
       
        res(v.data)
      })
    })

  }
  
}